package me.idashu.attg.service;

import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.NoteEntity;
import me.idashu.attg.persistence.NoteMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NoteService {
	@Autowired
	private NoteMapper noteMapper;
	
	public int noteCount(){
		return noteMapper.noteCount();
	}
	
	public List<NoteEntity> noteList(Map<String, Object> map){
		return noteMapper.noteList(map);
	}
	
	public void deleteNote(int noteId){
		noteMapper.deleteNote(noteId);
	}
	
	public void insertNote(NoteEntity noteEntity){
		noteMapper.insertNote(noteEntity);
	}
	
	public List<NoteEntity> findAllNote(Map<String, Object> param){
		return noteMapper.findAllNote(param);
	}
	
	public int countNoteByContextId(int contextId){
		return noteMapper.countNoteByContextId(contextId);
	}
	
	public int countNoteByUserId(int userId){
		return noteMapper.countNoteByUserId(userId);
	}
	
	public List<NoteEntity> findAllNoteByUserID(Map<String, Object> param){
		return noteMapper.findAllNoteByUserID(param);
	}
	
	public List<NoteEntity> allNoteOrderByScore(Map<String, Object> param){
		return noteMapper.allNoteOrderByScore(param);
	}
	
	public NoteEntity findNewNotesByUserId(long userId){
		NoteEntity user = noteMapper.findNewNotesByUserId(userId);
		return user;
	}
	
	public void upNote(int noteId){
		noteMapper.upNote(noteId);
	}
	
	public void downNote(int noteId){
		noteMapper.downNote(noteId);
	}
	
	public int countDataStatistics(){
		return noteMapper.countDataStatistics();
	}
	
	public List<NoteEntity> noteDataStatistics(Map<String, Object> map){
		return noteMapper.noteDataStatistics(map);
	}
}
